package cn.itcast.nems.oldems.service;

import cn.itcast.nems.base.dto.DiscountsDTO;
import cn.itcast.nems.discounts.dao.dataobject.EmsDiscountsDO;
import cn.itcast.nems.discounts.dao.entiry.EmsDiscounts;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.lang.NonNull;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

public interface DiscountsService extends IService<EmsDiscounts> {
   /**
    * 分页查询
    * @param page 分页参数
    * @param discountsDO 搜索条件
    * @return 分页数据
    */
   IPage<EmsDiscountsDO> findPageList(Page<EmsDiscountsDO> page, EmsDiscountsDO discountsDO) ;

    DiscountsDTO transferDiscountDTO(EmsDiscountsDO discountsDO);
    DiscountsDTO transferDiscountDTO(EmsDiscountsDO discountsDO , BigDecimal tuitionFee);

    DiscountsDTO transferDiscountDTO(EmsDiscountsDO discountsDO, BigDecimal tuitionFee, Integer remainMoney);

    /**
     * 根据优惠券ID获取优惠详情
     *
     * @param id 优惠券ID
     * @return cn.itcast.nems.discounts.dao.dataobject.EmsDiscountsDO
     * @author 高昌露
     * @since 2023/12/8 18:04
     */
    EmsDiscountsDO queryById(Integer id);

    /**
     * 根据优惠券ID集合获取优惠详情
     *
     * @param ids 优惠券ID集合
     * @return java.util.List<cn.itcast.nems.discounts.dao.dataobject.EmsDiscountsDO>
     * @author 高昌露
     * @since 2023/12/9 14:21
     */
    List<EmsDiscountsDO> queryByIds(@NonNull Set<Integer> ids);
}
